<!--
 * @Author: xxx
 * @Description:
-->
<template>
  <div class="SearchRegion">
    <el-dropdown trigger="click" size="default" @command="handleCommand">
      <div class="avatar-region">
        <el-avatar
          src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"
        />
        <span class="avatar-name">菜菜</span>
        <el-icon><arrow-down /></el-icon>
      </div>
      <template #dropdown>
        <el-dropdown-menu>
          <el-dropdown-item command="个人中心">个人中心</el-dropdown-item>
          <el-dropdown-item command="修改密码">修改密码</el-dropdown-item>
          <el-dropdown-item command="退出登录" divided
            >退出登录</el-dropdown-item
          >
        </el-dropdown-menu>
      </template>
    </el-dropdown>
  </div>
</template>

<script setup>
import { computed } from "vue";
// import { useStore } from 'vuex'
// import permissionHelper from '@/libs/PermissionHelper'

import { Search, ArrowDown, CaretBottom } from "@element-plus/icons-vue";
import { useRouter } from "vue-router";
let router = useRouter();

// let store = useStore()

// let tabSystemTitle = computed(
//   () => store.state.permissionStoreModule.tabSystemTitle
// )

// let brandList = computed(() => store.state.permissionStoreModule.brandList)

// let baseList = computed(() => store.state.permissionStoreModule.baseList)

// let goPath = computed(() => store.getters['permissionStoreModule/goPath'])

// let setGroupValue = (payload) =>
//   store.commit('permissionStoreModule/setGroupValue', payload)

// let setBaseValue = (payload) =>
//   store.commit('permissionStoreModule/setBaseValue', payload)

// let clearTabVisitedList = (payload) =>
//   store.commit('permissionStoreModule/clearTabVisitedList')

// let groupValue = computed({
//   get: () => store.state.permissionStoreModule.groupValue,
//   set: (val) => {
//     setGroupValue(val)
//   },
// })
// let baseValue = computed({
//   get: () => store.state.permissionStoreModule.baseValue,
//   set: (val) => {
//     setBaseValue(val)
//   },
// })
let baseValue = ref([]);
let baseList = ref([
  {
    baseName: "退出登录",
    baseId: "1",
  },
]);
// 获取品牌名称
// let getBrandName = () => {
//   let group = brandList.value.filter((item) => {
//     if (item.groupId === groupValue.value) {
//       return item
//     }
//   })
//   return group[0].brandName
// }

let handleChange = async (val, title) => {
  // if (val === 'admin0') {
  //   return
  // }
  // clearTabVisitedList()
  // await permissionHelper.initRouter(val, title)
  router.push({
    path: goPath.value,
  });
  setTimeout(() => {
    location.reload();
  }, 100);
};
</script>
<style lang="less">
.SelectRegion {
  .el-input--small .el-input__inner {
    width: 80px;
  }
}
</style>

<style lang="less" scoped>
.SelectRegion {
  max-width: 280px;
  height: 60px;
  padding-right: 10px;
  border-bottom: 1px solid #e6e6e6;
  font-size: 14px;
  .group {
    max-width: 280px;
  }
  .select-item {
    height: 100%;
    display: flex;
    align-items: center;
    .label {
      color: #a9a9a9;
      margin-right: 5px;
    }
  }
}
</style>
